/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  							 script_creature_action.h

	$Header: /heroes4/script_creature_action.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( SCRIPT_CREATURE_ACTION_H_INCLUDED )
#define SCRIPT_CREATURE_ACTION_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "creature_type.h"
#include "script_action_type.h"
#include "script_army_action.h"

// --------------------------------------------------------------------------
// t_script_creature_action class
// --------------------------------------------------------------------------

class t_script_creature_action
	:	public t_script_army_action
{
public:
	// Constructor
	t_script_creature_action();

	// Member functions
	t_creature_type	get_creature_type() const;
	int				get_quantity() const;
	
	virtual bool	read( std::streambuf& stream, int version );
	virtual bool	read_from_map(
						std::streambuf &	stream,
						int					format_version );
	virtual bool	write( std::streambuf& stream ) const;

private:
	// Data members
	t_creature_type	m_creature_type;
	int				m_quantity;
};

class t_script_give_creatures
	: public t_script_creature_action
{
public:
	virtual void	do_action(t_creature_array* array) const;

	virtual void	add_icons(t_basic_dialog* dialog) const;
};

class t_script_take_creatures
	: public t_script_creature_action
{
public:
	virtual void	do_action(t_creature_array* array) const;

	virtual void	add_icons(t_basic_dialog* dialog) const;
};

// --------------------------------------------------------------------------
// t_script_creature_action inline members
// --------------------------------------------------------------------------

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_script_creature_action::t_script_creature_action()
	:	m_creature_type( k_creature_none ),
		m_quantity( 0 )
{
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline t_creature_type t_script_creature_action::get_creature_type() const
{
	return m_creature_type;
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
inline int t_script_creature_action::get_quantity() const
{
	return m_quantity;
}

SPECIALIZE_SCRIPT_ACTION( k_script_action_give_creatures, t_script_give_creatures );
SPECIALIZE_SCRIPT_ACTION( k_script_action_take_creatures, t_script_take_creatures );

#endif // !defined( SCRIPT_CREATURE_ACTION_H_INCLUDED )
